package io.renren.modules.sys.shiro;

import io.renren.modules.sys.entity.SysUserEntity;
import org.apache.shiro.authc.AuthenticationToken;

/**
 * @auther guqianbin
 * @date 2019/11/7 21:42
 **/
public class OAuth2Token implements AuthenticationToken {
    public OAuth2Token(String authCode) {
        this.authCode = authCode;
    }

    public OAuth2Token(String authCode, String username, String oauthUserId) {
        this.authCode = authCode;
        this.username = username;
        this.oauthUserId = oauthUserId;
    }

    private String authCode;
    private String principal;

    private String username;

    private String oauthUserId;

    private SysUserEntity sysUserEntity;

    public SysUserEntity getSysUserEntity() {
        return sysUserEntity;
    }

    public void setSysUserEntity(SysUserEntity sysUserEntity) {
        this.sysUserEntity = sysUserEntity;
    }

    public String getOauthUserId() {
        return oauthUserId;
    }

    public void setOauthUserId(String oauthUserId) {
        this.oauthUserId = oauthUserId;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getAuthCode() {
        return authCode;
    }

    public void setAuthCode(String authCode) {
        this.authCode = authCode;
    }

    @Override
    public String getPrincipal() {
        return principal;
    }

    public void setPrincipal(String principal) {
        this.principal = principal;
    }

    @Override
    public Object getCredentials() {
        return authCode;
    }
}
